//关于home页面的请求
import request from "./request";

export function getAllBook() {
  return request.get("/api/book/findAll");
}
//分页查询
export function getAllBookByLimit(currentPage,size){
  return request.get(`/api/book/findAll/${currentPage}/${size}`)
}
//借阅图书
export function addBorrows(userId,bookId) {
  return request.post(`/api/borrow/add/${bookId}/${userId}`)
}
//查询当前用户借阅图书
export function getUserBorrows(userId) {
  return request.get(`/api/borrow/findByUserId/${userId}`)
}
//更新用户
export function updateUser(newUserObj) {
  return request.post("/api/user/update",{
    id:newUserObj.id,
    avatar:newUserObj.avatar,
    password:newUserObj.password,
  })
}





